<%user_class = "Student"%>
<div class="left-uppercolumn-one">
  <div class="masthead"> </div>
  <div class="details">
    <p class="note">Housings, jobs, internships, buying vehicles and much more all near your campus!!!</p>
  </div>
  <div>

     <%@user_types.each do |category| -%>
    <div class="links">
    <div class="group_title">
      <%= link_to h(category.label_for_userType(user_class)), { :controller=> "listings" , :id => category.id} -%>
    </div>
    <%category.sub_categories.each do |sub_category| -%>
      <div> <%=h(sub_category.name) -%> </div>
    <%end-%>
    </div>
  <%end-%>
</div>


<div style="clear:both"></div>
<div class="left-lowercolumn">

  <h2 class="style9">Whats Inside</h2>

  <div class="left-lowercolumn-one">
    <div class="lower_block">
<%@advertisments.each do |ad| %>

   <%subcat=SubCategory.find(ad.sub_category_id)  -%>
   <%category=Category.find(subcat.category_id)-%>
   <%user=User.find(ad.user_id)-%>
   <%university=University.find(ad.university_id)-%>

 
<%require 'htmlentities'
coder = HTMLEntities.new
%>
  


    <div>
        <div class="lower_heading"><%=h category.name -%></div>
        <div class="lower_heading_line"><%=h coder.decode(ad.title.capitalize) -%></div>
        <div><%=h coder.decode(excerpt(ad.description.downcase , ' ', 100)) -%></div>
        <div class="lower_heading_line1">posted on <%=h ad.created_at.to_formatted_s(:long_ordinal) -%></div>
        <div class="lower_heading_line1">posted in <%=h university.name-%></div>
        <div class="lower_heading_line1">posted by <%=h user.name-%></div>

      </div>

<div style="clear:both;">&nbsp;</div>


<%end%>
<div>
<%#=render :partial => "layouts/paginator", :locals => {:entities => @advertisments},:params => params[:id]-%>

</div>



    
     
    </div>
  </div>
</div>
</div>




